import qs from "qs"
import url from '@/url.config'

export default ({service, request, tools}) => ({
    // 库存入库
    PostsaveSpareInfo(data) {
        return request({
            url: url.ip3 + "/spare/saveSpareInfo",
            method: "post",
            data: data
        })
    },
    //单独入库
    PostsaveOneSpareInfo(data) {
        return request({
            url: url.ip3 + "/spare/save/one/info",
            method: "post",
            data: data
        })
    },
    // 申领入库
    PostspareApply(data) {
        return request({
            url: url.ip3 + "/spare/spareApply",
            method: "post",
            data: data
        })
    },
    // 获取申领详情
    PostlistApplyDetails(data) {
        return request({
            url: url.ip3 + "/spare/listApplyDetails",
            method: "post",
            data: data
        })
    },
    // 获取库存统计
    PostlistInventory(data) {
        return request({
            url: url.ip3 + "/spare/listInventory",
            method: "post",
            data: data
        })
    },
    //模态框未出库详情
    PostnotOutbound(data) {
        return request({
            url: url.ip3 + "/spare/notOutbound/detail",
            method: "post",
            data: data
        })
    },
    //模态框出库未运行
    PostoutBound(data) {
        return request({
            url: url.ip3 + "/spare/find/version/apply",
            method: "post",
            data: data
        })
    },
    //模态框出库已运行
    PostoutrunDetail(data) {
        return request({
            url: url.ip3 + "/spare/outBound/runDetail",
            method: "post",
            data: data
        })
    },
    //获取当前申领记录的申领详情
    GetgetSpareDetail(id) {
        return request({
            url: url.ip3 + `/spare/get/apply/detail/${id}`,
            method: "get",
        })
    },
    //获取同型号下的申领记录
    PostVersionApply(data) {
        return request({
            url: url.ip3 + "/spare/find/version/apply",
            method: "post",
            data: data
        })
    },
    //申领库存中查找列表信息
    PostRepairsList(data) {
        return request({
            url: url.ip3 + "/spare/equipment/repairs/list",
            method: "post",
            data: data
        })
    },
    //填写更换记录
    PostWriteRepair(data) {
        return request({
            url: url.ip3 + "/spare/write/repair",
            method: "post",
            data: data
        })
    },
    //查询设备获取设备id
    PostEquipmentFindPage(data) {
        return request({
            url: url.ip3 + "/equipment/findByPage",
            method: "post",
            data: data
        })
    },
    //查询公司
    GetfindCompanyIdAndName() {
        return request({
            url: url.ip2 + "/company/findCompanyIdAndName",
            method: "get",
        })
    },
    //获取所有大区-项目组-运维点
    GetAllAreas() {
        return request({
            url: url.ip2 + "/area/getAllAreas",
            method: "get",
        })
    },
    //查找物资分类
    GetfindGoodFindType() {
        return request({
            url: url.ip3 + "/goods/find/type",
            method: "get",
        })
    },

    //================================z======================
    saveGoods(data) {
        return request({
            url: url.ip3 + "/goods/save/goods",
            method: "post",
            data: data,
        })
    },
    //获取初始物资信息
    getinitGoods(data) {
        return request({
            url: url.ip3 + "/goods/find/type",
            method: "get",
            data: data,
        })
    },
    //获取批次信息
    getInitProcurementBatch(data) {
        return request({
            url: url.ip3 + "/procurement/get/batch",
            method: "get",
            data: data,
        })
    },
    //获取物资字典
    getGoodsDir(data) {
        return request({
            url: url.ip3 + "/goods/find/directory",
            method: "post",
            data: data,
        })
    },
    //查询当前区域下的物资信息
    getAreaGoodsInfo(data) {
        return request({
            url: url.ip3 + "/goods/find/area/goods",
            method: "post",
            data: data,
        })
    },
    //查询当前区域下的物资信息
    getAreaInfo(data) {
        return request({
            url: url.ip2 + "/area/findAreaByUserId",
            method: "get",
            data: data,
        })
    },
    //查询当前区域下的物资信息
    getGoodsTypeTotal(id) {
        return request({
            url: url.ip3 + "/goods/goods/number/" + id,
            method: "get"
        })
    },
    //物资申领
    goodsApply(data) {
        return request({
            url: url.ip3 + "/goods/save/apply/log",
            method: "post",
            data: data,
        })
    },
    // 删除物资
    goodsRemoveGoods(data) {
        return request({
            url: url.ip3 + "/goods/removeGoods",
            method: "post",
            data: data
        })
    },
    //导出申请采购数据
    exportApply(data) {
        return request({
            url: url.ip3 + "/procurement/export/excel",
            method: "post",
            data: data
        })
    },

    //查找待审核的物资信息
    goodsApplyinfo(data) {
        return request({
            url: url.ip3 + "/goods/find/wait/apply",
            method: "post",
            data: data
        })
    },
    //查找待审核的物资信息
    lcinfo(id) {
        return request({
            url: url.ip3 + `/procurement/get/opinion/${id}`,
            method: "get",
        })
    },
    //物资审核
    wzshinfo(data) {
        return request({
            url: url.ip3 + "/goods/goods/apply/audit",
            method: "post",
            data: data,
        })
    },
    //物资退回
    backgoodsinfo(data) {
        return request({
            url: url.ip3 + "/goods/save/back/goods",
            method: "post",
            data: data,
        })
    },
    //物资退回信息
    getbackgoodsinfo(data) {
        return request({
            url: url.ip3 + "/goods/get/back/log",
            method: "post",
            data: data,
        })
    },

})
